//
//  SingerMvTableViewCell.m
//  Coco_Music
//
//  Created by dlios on 15-6-27.
//  Copyright (c) 2015年 寇广超. All rights reserved.
//

#import "SingerMvTableViewCell.h"

@implementation SingerMvTableViewCell
-(void)dealloc
{
    [_SingerNameLabel release];
    [_singMV release];
    [_NameLabel release];
    [_SingerNameLabel release];
    [_pickLabel release];
    [_praiseLabel release];
    [super dealloc];
    
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self =[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
}
-(void)createSubViews
{
    self.myImageView =[[UIImageView alloc]initWithFrame:CGRectMake(10, 20,100,80)];
    self.myImageView.layer.masksToBounds = YES;
    self.myImageView.layer.cornerRadius = 20;
    self.myImageView.layer.borderWidth = 1;
    self.myImageView.layer.borderColor =[[UIColor lightGrayColor]CGColor];
    [self.contentView addSubview:self.myImageView];
    [_myImageView release];
    
    self.NameLabel =[[UILabel alloc]initWithFrame:CGRectMake(self.myImageView.frame.origin.x+self.myImageView.frame.size.width + 15, self.myImageView.frame.origin.y+5, [UIScreen mainScreen].bounds.size.height/3, 30)];
    [self.contentView addSubview:self.NameLabel];
    [_NameLabel release];
    
    self.SingerNameLabel =[[UILabel alloc]initWithFrame:CGRectMake(self.NameLabel.frame.origin.x, self.NameLabel.frame.origin.y+self.NameLabel.frame.size.height, [UIScreen mainScreen].bounds.size.height/3, 20)];
    self.SingerNameLabel.font =[UIFont systemFontOfSize:15];
    [self.contentView addSubview:self.SingerNameLabel];
    [_SingerNameLabel release];
    
    self.pickLabel =[[UILabel alloc]initWithFrame:CGRectMake(self.SingerNameLabel.frame.origin.x, self.SingerNameLabel.frame.origin.y+self.SingerNameLabel.frame.size.height, 120, 20)];
    self.pickLabel.font =[UIFont systemFontOfSize:15];
    [self.contentView addSubview:self.pickLabel];
    [_pickLabel release];
    
    self.praiseLabel =[[UILabel alloc]initWithFrame:CGRectMake(self.pickLabel.frame.origin.x+self.pickLabel.frame.size.width, self.pickLabel.frame.origin.y, self.pickLabel.frame.size.width, self.pickLabel.frame.size.height)];
    self.praiseLabel.font =[UIFont systemFontOfSize:15];
    [self.contentView addSubview:self.praiseLabel];
    [_praiseLabel release];
    
    UIImageView *ImageV =[[UIImageView alloc]initWithFrame:CGRectMake(self.myImageView.frame.origin.x+20, self.praiseLabel.frame.size.height+self.praiseLabel.frame.origin.y+10, [UIScreen mainScreen].bounds.size.width-self.myImageView.frame.origin.x*2-40 ,2)];
    ImageV.backgroundColor =[UIColor lightGrayColor];
    [self addSubview:ImageV];
    [ImageV release];
    
}
-(void)setSingMV:(SingerMV *)singMV
{
    if (_singMV != singMV) {
        [_singMV release];
        _singMV =[singMV retain];
    }
    self.NameLabel.text = singMV.videoName;
    self.SingerNameLabel.text = singMV.singerName;
    self.pickLabel.text =[NSString stringWithFormat:@"点击量:%ld",(long)singMV.pickCount];

    

    
    
    NSURL *url =[NSURL URLWithString:singMV.picUrl];
  
    
    [self.myImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"cm2_default_artist_banner-1"]];
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
